;
var helper = require("../../javascript/helper");
var db = require("../../javascript/mysql");
var mysql = new db.mysqlClient("accident");
function genProductInfo() {
    var prices = ["3.00", "4.00", "5.00", "6.00", "6.00", "7.00", "8.00", "9.00", "20.00", "25.00", "26.00", "28.00"];
    var index = 0;
    plan = {
        "planA": {
            "year": ["0-75"],
            "days": ["7d", "10d", "15d", "1m"],
            "people_count": ["1"],
            "airplane_death": ["200000"],
            "train_death": ["100000"],
            "ship_death": ["100000"],
            "bus_death": ["50000"]
        },
        "planB": {
            "year": ["0-75"],
            "days": ["7d", "10d", "15d", "1m"],
            "people_count": ["1"],
            "airplane_death": ["500000"],
            "train_death": ["300000"],
            "ship_death": ["100000"],
            "bus_death": ["200000"]
        },
        "planC": {
            "year": ["0-75"],
            "days": ["7d", "10d", "15d", "1m"],
            "people_count": ["1"],
            "airplane_death": ["20000000"],
            "train_death": ["500000"],
            "ship_death": ["100000"],
            "bus_death": ["500000"]
        }
    }
    for (k in plan) {
        data = helper.product([plan[k]["year"], plan[k]["days"], plan[k]["people_count"], plan[k]["airplane_death"], plan[k]["train_death"], plan[k]["ship_death"], plan[k]["bus_death"]])
        for (i = 0; i < data.length; i++) {
            dt = helper.formatProductInfo(data[i], plan[k])
            dt.name = "交通工具意外伤害保险（短期）"
            dt.company = "建信财险"
            dt.price = prices[index]
            mysql.insertData(dt);
            index++

        }
    }
    mysql.close();

}